<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Pin: LOCK: Locking Primitives</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Pin
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">LOCK: Locking Primitives<div class="ingroups"><a class="el" href="group__UTIL__REF.html">Utilities API Reference</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structPIN__LOCK.html">PIN_LOCK</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga217cbb364b3339e20d2d3f3fbe0bb712"><td class="memItemLeft" align="right" valign="top">typedef PINVM::PINSYNC_POD_LOCK&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a></td></tr>
<tr class="separator:ga217cbb364b3339e20d2d3f3fbe0bb712"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga34b6e9367817716d0b85f804fba4ffea"><td class="memItemLeft" align="right" valign="top">typedef PINVM::PINSYNC_POD_RWLOCK&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a></td></tr>
<tr class="separator:ga34b6e9367817716d0b85f804fba4ffea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga483703255c7ea848f92a84df4768495e"><td class="memItemLeft" align="right" valign="top">typedef PINVM::PINSYNC_POD_SEMAPHORE&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a></td></tr>
<tr class="separator:ga483703255c7ea848f92a84df4768495e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2d70a3db262121f240e8b91f7f9a3af7"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga2d70a3db262121f240e8b91f7f9a3af7">PIN_InitLock</a> (<a class="el" href="structPIN__LOCK.html">PIN_LOCK</a> *lock)</td></tr>
<tr class="separator:ga2d70a3db262121f240e8b91f7f9a3af7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae2608acfad1d1790a6d0d31e1d95f050"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#gae2608acfad1d1790a6d0d31e1d95f050">PIN_GetLock</a> (<a class="el" href="structPIN__LOCK.html">PIN_LOCK</a> *lock, INT32 val)</td></tr>
<tr class="separator:gae2608acfad1d1790a6d0d31e1d95f050"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga35d97edadbd43507e71fa7fe85904ed6"><td class="memItemLeft" align="right" valign="top">INT32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga35d97edadbd43507e71fa7fe85904ed6">PIN_ReleaseLock</a> (<a class="el" href="structPIN__LOCK.html">PIN_LOCK</a> *lock)</td></tr>
<tr class="separator:ga35d97edadbd43507e71fa7fe85904ed6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab2ccb8ea978654f4c0d9cadba96ee9ed"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#gab2ccb8ea978654f4c0d9cadba96ee9ed">PIN_MutexInit</a> (<a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a> *lock)</td></tr>
<tr class="separator:gab2ccb8ea978654f4c0d9cadba96ee9ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga05f3629492c36f7aed88c2a3a17f48ea"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga05f3629492c36f7aed88c2a3a17f48ea">PIN_MutexFini</a> (<a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a> *lock)</td></tr>
<tr class="separator:ga05f3629492c36f7aed88c2a3a17f48ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5234870e9082eac1e51dda77e7fb3b93"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga5234870e9082eac1e51dda77e7fb3b93">PIN_MutexLock</a> (<a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a> *lock)</td></tr>
<tr class="separator:ga5234870e9082eac1e51dda77e7fb3b93"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf75d66d693aa94f61e04d718e3db1e24"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#gaf75d66d693aa94f61e04d718e3db1e24">PIN_MutexUnlock</a> (<a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a> *lock)</td></tr>
<tr class="separator:gaf75d66d693aa94f61e04d718e3db1e24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacb556c313cc4366e17e94fe927319453"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#gacb556c313cc4366e17e94fe927319453">PIN_MutexTryLock</a> (<a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a> *lock)</td></tr>
<tr class="separator:gacb556c313cc4366e17e94fe927319453"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa62d889dd0a931856fa569af553d1ca0"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#gaa62d889dd0a931856fa569af553d1ca0">PIN_RWMutexInit</a> (<a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *lock)</td></tr>
<tr class="separator:gaa62d889dd0a931856fa569af553d1ca0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4f05eb08f60536ca79af4e81291abd1b"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga4f05eb08f60536ca79af4e81291abd1b">PIN_RWMutexFini</a> (<a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *lock)</td></tr>
<tr class="separator:ga4f05eb08f60536ca79af4e81291abd1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4aba2f3d4b6801946dee277391801d24"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga4aba2f3d4b6801946dee277391801d24">PIN_RWMutexReadLock</a> (<a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *lock)</td></tr>
<tr class="separator:ga4aba2f3d4b6801946dee277391801d24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae0f81460ebb750ee6f953bf30d06f453"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#gae0f81460ebb750ee6f953bf30d06f453">PIN_RWMutexWriteLock</a> (<a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *lock)</td></tr>
<tr class="separator:gae0f81460ebb750ee6f953bf30d06f453"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga951173ca76976ea8f4d1ed58165f4cca"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga951173ca76976ea8f4d1ed58165f4cca">PIN_RWMutexUnlock</a> (<a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *lock)</td></tr>
<tr class="separator:ga951173ca76976ea8f4d1ed58165f4cca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6688c2a2fecc786e9f9ea77a5f2829ad"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga6688c2a2fecc786e9f9ea77a5f2829ad">PIN_RWMutexTryReadLock</a> (<a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *lock)</td></tr>
<tr class="separator:ga6688c2a2fecc786e9f9ea77a5f2829ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8d5910392c3f1d29b57695cd5ce47a66"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga8d5910392c3f1d29b57695cd5ce47a66">PIN_RWMutexTryWriteLock</a> (<a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *lock)</td></tr>
<tr class="separator:ga8d5910392c3f1d29b57695cd5ce47a66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga957147cc7332eea7e8225915f8c8f3ec"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga957147cc7332eea7e8225915f8c8f3ec">PIN_SemaphoreInit</a> (<a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *sem)</td></tr>
<tr class="separator:ga957147cc7332eea7e8225915f8c8f3ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga637f352cc6bea9ac2183db0b8c0b93ce"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga637f352cc6bea9ac2183db0b8c0b93ce">PIN_SemaphoreFini</a> (<a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *sem)</td></tr>
<tr class="separator:ga637f352cc6bea9ac2183db0b8c0b93ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf3aeec45644bc5b29b12288dd9dcbcfe"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#gaf3aeec45644bc5b29b12288dd9dcbcfe">PIN_SemaphoreSet</a> (<a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *sem)</td></tr>
<tr class="separator:gaf3aeec45644bc5b29b12288dd9dcbcfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8e0ac679404eb3cac378852cdb4364c6"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga8e0ac679404eb3cac378852cdb4364c6">PIN_SemaphoreClear</a> (<a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *sem)</td></tr>
<tr class="separator:ga8e0ac679404eb3cac378852cdb4364c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6f2b50096f0e12315b7e3aedc958cbce"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga6f2b50096f0e12315b7e3aedc958cbce">PIN_SemaphoreIsSet</a> (<a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *sem)</td></tr>
<tr class="separator:ga6f2b50096f0e12315b7e3aedc958cbce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7cde56fb65209574e72bbabc2ee45d40"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga7cde56fb65209574e72bbabc2ee45d40">PIN_SemaphoreWait</a> (<a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *sem)</td></tr>
<tr class="separator:ga7cde56fb65209574e72bbabc2ee45d40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0ffd3cd1e212cb6a17bf1dba50c76d8d"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__LOCK.html#ga0ffd3cd1e212cb6a17bf1dba50c76d8d">PIN_SemaphoreTimedWait</a> (<a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *sem, unsigned timeout)</td></tr>
<tr class="separator:ga0ffd3cd1e212cb6a17bf1dba50c76d8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Primitives for locking.<br  />
APIs from this group are available in any thread, including any internal thread spawned by the tool.</p>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux &amp; Windows<br  />
<b>CPU:</b> All<br  />
</dd></dl>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga217cbb364b3339e20d2d3f3fbe0bb712"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga217cbb364b3339e20d2d3f3fbe0bb712">&#9670;&nbsp;</a></span>PIN_MUTEX</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef PINVM::PINSYNC_POD_LOCK <a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A simple non-recursive lock. PIN_MUTEX is different from <a class="el" href="structPIN__LOCK.html">PIN_LOCK</a> because it provides just mutex locking without an extra "lock owner" parameter.</p>
<dl class="section note"><dt>Note</dt><dd>For performance reasons this type request through compiler attributes to be aligned to a memory cache line (64 bytes). For statically allocated objects of this type it is enough. However, when allocating it dynamically it is advised to use allocation operation that enforces this alignment (e.g., memalign) </dd></dl>

</div>
</div>
<a id="ga34b6e9367817716d0b85f804fba4ffea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga34b6e9367817716d0b85f804fba4ffea">&#9670;&nbsp;</a></span>PIN_RWMUTEX</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef PINVM::PINSYNC_POD_RWLOCK <a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A non-recursive multiple-reader / single-writer lock. Use this lock when multiple "reader" threads can simultaneously access a shared resource, but "writer" threads need to have exclusive access. This is a write-biased lock: if a writer thread blocks on the lock because there are active readers, new readers are prevented from acquiring the lock until the writer gets access. This prevents starvation of writer threads.</p>
<dl class="section note"><dt>Note</dt><dd>For performance reasons this type request through compiler attributes to be aligned to a memory cache line (64 bytes). For statically allocated objects of this type it is enough. However, when allocating it dynamically it is advised to use allocation operation that enforces this alignment (e.g., memalign) </dd></dl>

</div>
</div>
<a id="ga483703255c7ea848f92a84df4768495e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga483703255c7ea848f92a84df4768495e">&#9670;&nbsp;</a></span>PIN_SEMAPHORE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef PINVM::PINSYNC_POD_SEMAPHORE <a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A binary semaphore synchronization object. You can use this synchronization when one thread needs to wait for some condition to become true. A binary semaphore has exactly two states: "set" and "clear". It is possible for one or more threads to wait for the semaphore to become "set". Those threads resume when some other thread changes the state to "set".</p>
<p>Note that it is generally not safe to wait on a PIN_SEMAPHORE from an analysis routine or from a call-back function. Most Pin call-back functions are called while Pin holds an internal lock (the VM lock). Therefore, if you wait on a PIN_SEMAPHORE from a call-back, you will prevent any other thread from entering any call-back function (because the waiting thread also holds the VM lock). There is also a danger when waiting on a PIN_SEMAPHORE from an analysis routine. If a thread waits on a semaphore from an analysis routine, the application may also hold some locks of its own. Thus, you can cause a deadlock in the application if you wait on a semaphore while the application holds its own lock.</p>
<p>The dangers listed above do not exist if you wait on a PIN_SEMAPHORE from a Pin internal thread (see <a class="el" href="group__THREADS.html#ga23fe7ae94deab5bf574ff601d3d85a6b">PIN_SpawnInternalThread()</a>). Also, it is safe to set, clear, or test a semaphore from any thread, even when executing an analysis routine or call-back function.</p>
<dl class="section note"><dt>Note</dt><dd>For performance reasons this type request through compiler attributes to be aligned to a memory cache line (64 bytes). For statically allocated objects of this type it is enough. However, when allocating it dynamically it is advised to use allocation operation that enforces this alignment (e.g., memalign) </dd></dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gae2608acfad1d1790a6d0d31e1d95f050"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae2608acfad1d1790a6d0d31e1d95f050">&#9670;&nbsp;</a></span>PIN_GetLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_GetLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structPIN__LOCK.html">PIN_LOCK</a> *&#160;</td>
          <td class="paramname"><em>lock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">INT32&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Acquire the lock.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Used for debugging. Typically, this is the ID of the calling thread. See the <em>_owner</em> field of <a class="el" href="structPIN__LOCK.html">PIN_LOCK</a>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga2d70a3db262121f240e8b91f7f9a3af7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2d70a3db262121f240e8b91f7f9a3af7">&#9670;&nbsp;</a></span>PIN_InitLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_InitLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structPIN__LOCK.html">PIN_LOCK</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize the lock as free</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable to initialize. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga05f3629492c36f7aed88c2a3a17f48ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga05f3629492c36f7aed88c2a3a17f48ea">&#9670;&nbsp;</a></span>PIN_MutexFini()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_MutexFini </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy the PIN_MUTEX and deallocate resources. If you want to use the lock object again later, you must call <a class="el" href="group__LOCK.html#gab2ccb8ea978654f4c0d9cadba96ee9ed">PIN_MutexInit()</a> again.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gab2ccb8ea978654f4c0d9cadba96ee9ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab2ccb8ea978654f4c0d9cadba96ee9ed">&#9670;&nbsp;</a></span>PIN_MutexInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL PIN_MutexInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function must be called to initialize a PIN_MUTEX before it is used.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on successful initialization. If FALSE is returned, initialization failed, and the PIN_MUTEX may not be used. </dd></dl>

</div>
</div>
<a id="ga5234870e9082eac1e51dda77e7fb3b93"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5234870e9082eac1e51dda77e7fb3b93">&#9670;&nbsp;</a></span>PIN_MutexLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_MutexLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Block the caller until the lock can be acquired.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gacb556c313cc4366e17e94fe927319453"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacb556c313cc4366e17e94fe927319453">&#9670;&nbsp;</a></span>PIN_MutexTryLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL PIN_MutexTryLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Try to acquire the lock, but do not block the caller.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE if the lock is acquired, FALSE if not. </dd></dl>

</div>
</div>
<a id="gaf75d66d693aa94f61e04d718e3db1e24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf75d66d693aa94f61e04d718e3db1e24">&#9670;&nbsp;</a></span>PIN_MutexUnlock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_MutexUnlock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga217cbb364b3339e20d2d3f3fbe0bb712">PIN_MUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Release the lock.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga35d97edadbd43507e71fa7fe85904ed6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga35d97edadbd43507e71fa7fe85904ed6">&#9670;&nbsp;</a></span>PIN_ReleaseLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">INT32 PIN_ReleaseLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structPIN__LOCK.html">PIN_LOCK</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Release the lock.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The <em>val</em> parameter that was passed to <a class="el" href="group__LOCK.html#gae2608acfad1d1790a6d0d31e1d95f050">PIN_GetLock()</a> when the lock was acquired. Typically, this is the ID of the thread that owned the lock. </dd></dl>

</div>
</div>
<a id="ga4f05eb08f60536ca79af4e81291abd1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4f05eb08f60536ca79af4e81291abd1b">&#9670;&nbsp;</a></span>PIN_RWMutexFini()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_RWMutexFini </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy the PIN_RWMUTEX and deallocate resources. If you want to use the lock object again later, you must call <a class="el" href="group__LOCK.html#gaa62d889dd0a931856fa569af553d1ca0">PIN_RWMutexInit()</a> again.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaa62d889dd0a931856fa569af553d1ca0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa62d889dd0a931856fa569af553d1ca0">&#9670;&nbsp;</a></span>PIN_RWMutexInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL PIN_RWMutexInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function must be called to initialize a PIN_RWMUTEX before it is used.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on successful initialization. If FALSE is returned, initialization failed, and the PIN_RWMUTEX may not be used. </dd></dl>

</div>
</div>
<a id="ga4aba2f3d4b6801946dee277391801d24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4aba2f3d4b6801946dee277391801d24">&#9670;&nbsp;</a></span>PIN_RWMutexReadLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_RWMutexReadLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Acquire the lock for "read" access, blocking if necessary. Multiple readers may simultaneously hold the same lock.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga6688c2a2fecc786e9f9ea77a5f2829ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6688c2a2fecc786e9f9ea77a5f2829ad">&#9670;&nbsp;</a></span>PIN_RWMutexTryReadLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL PIN_RWMutexTryReadLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Attempts to acquire the lock as a reader, but does not block the caller.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE if the lock is acquired, FALSE if not. </dd></dl>

</div>
</div>
<a id="ga8d5910392c3f1d29b57695cd5ce47a66"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8d5910392c3f1d29b57695cd5ce47a66">&#9670;&nbsp;</a></span>PIN_RWMutexTryWriteLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL PIN_RWMutexTryWriteLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Attempts to acquire the lock as a writer, but does not block the caller.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE if the lock is acquired, FALSE if not. </dd></dl>

</div>
</div>
<a id="ga951173ca76976ea8f4d1ed58165f4cca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga951173ca76976ea8f4d1ed58165f4cca">&#9670;&nbsp;</a></span>PIN_RWMutexUnlock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_RWMutexUnlock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Release the lock. Used for both "readers" and "writers".</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gae0f81460ebb750ee6f953bf30d06f453"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae0f81460ebb750ee6f953bf30d06f453">&#9670;&nbsp;</a></span>PIN_RWMutexWriteLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_RWMutexWriteLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga34b6e9367817716d0b85f804fba4ffea">PIN_RWMUTEX</a> *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Acquire the lock for "write" access, blocking if necessary. A writer has exclusive ownership of the lock, not shared with any other readers or writers.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lock</td><td>The lock variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga8e0ac679404eb3cac378852cdb4364c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8e0ac679404eb3cac378852cdb4364c6">&#9670;&nbsp;</a></span>PIN_SemaphoreClear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_SemaphoreClear </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Change the semaphore's state to "clear". This has no effect on any threads waiting on the semaphore.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">sem</td><td>The semaphore variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga637f352cc6bea9ac2183db0b8c0b93ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga637f352cc6bea9ac2183db0b8c0b93ce">&#9670;&nbsp;</a></span>PIN_SemaphoreFini()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_SemaphoreFini </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy the PIN_SEMAPHORE and deallocate resources. If you want to use the lock object again later, you must call <a class="el" href="group__LOCK.html#ga957147cc7332eea7e8225915f8c8f3ec">PIN_SemaphoreInit()</a> again.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">sem</td><td>The semaphore variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga957147cc7332eea7e8225915f8c8f3ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga957147cc7332eea7e8225915f8c8f3ec">&#9670;&nbsp;</a></span>PIN_SemaphoreInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL PIN_SemaphoreInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function must be called to initialize a PIN_SEMAPHORE before it is used.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">sem</td><td>The semaphore variable.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on successful initialization. If FALSE is returned, initialization failed, and the PIN_SEMAPHORE may not be used. </dd></dl>

</div>
</div>
<a id="ga6f2b50096f0e12315b7e3aedc958cbce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6f2b50096f0e12315b7e3aedc958cbce">&#9670;&nbsp;</a></span>PIN_SemaphoreIsSet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL PIN_SemaphoreIsSet </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Check whether the semaphore's state is "set", but do not block.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">sem</td><td>The semaphore variable.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE if the semaphore's state is "set". </dd></dl>

</div>
</div>
<a id="gaf3aeec45644bc5b29b12288dd9dcbcfe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf3aeec45644bc5b29b12288dd9dcbcfe">&#9670;&nbsp;</a></span>PIN_SemaphoreSet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_SemaphoreSet </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Change the semaphore's state to "set" and tell any threads waiting on the semaphore to wake up. Note that threads waiting on the semaphore may not resume running right away, and they are guaranteed to resume only if the semaphore's state is still "set" when they actually do resume.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">sem</td><td>The semaphore variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga0ffd3cd1e212cb6a17bf1dba50c76d8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0ffd3cd1e212cb6a17bf1dba50c76d8d">&#9670;&nbsp;</a></span>PIN_SemaphoreTimedWait()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL PIN_SemaphoreTimedWait </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *&#160;</td>
          <td class="paramname"><em>sem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Block the calling thread until the semaphore's state is "set" or until a timeout expires. The calling thread resumes immediately if the state is already "set".</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">sem</td><td>The semaphore variable. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The timeout period (milliseconds).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE if the semaphore's state is "set", FALSE if this method returns due to the timeout. </dd></dl>

</div>
</div>
<a id="ga7cde56fb65209574e72bbabc2ee45d40"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7cde56fb65209574e72bbabc2ee45d40">&#9670;&nbsp;</a></span>PIN_SemaphoreWait()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_SemaphoreWait </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__LOCK.html#ga483703255c7ea848f92a84df4768495e">PIN_SEMAPHORE</a> *&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Block the calling thread until the semaphore's state is "set". The calling thread resumes immediately if the state is already "set".</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">sem</td><td>The semaphore variable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
